using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;

public abstract class CommonPluginBuildProcessor : IPostprocessBuildWithReport
{
    public int callbackOrder => 10;

    protected const string OhPrePath = "/entry/src/main/resources/rawfile/Data/StreamingAssets/OpenHarmony";

    /**
    * build 构建完成后回调
    */
    public void OnPostprocessBuild(BuildReport report)
    {
        if (report.summary.platform == BuildTarget.OpenHarmony)
        {
            //修改文件
            DoRecordFile(report.summary.outputPath);
        }
    }


    /// <summary>
    /// 插件操作
    /// </summary>
    /// <param name="path">导出工程后的地址</param>
    protected abstract void DoRecordFile(string path);
}